package com.itheima.lambdaDemo;

public class LambdaDemo1 {
    public static void main(String[] args) {
        // JDK8之前
        method(new Swim() {
            @Override
            public void swimming() {
                System.out.println("正在游泳1");
            }
        });

        // JDK8之后
        method(
                () -> {
                    System.out.println("正在游泳2");
                }
        );
    }

    public static void method(Swim s){
        s.swimming();
    }
}

interface Swim{
    public abstract void swimming();
}
